package Servlets;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class CustomerLogout extends HttpServlet{
	public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException{
		doPost(request,response);
	}
	public void doPost(HttpServletRequest req,HttpServletResponse res) throws IOException{
		try{
			HttpSession session=req.getSession(false);
			session.removeAttribute("fname");
			session.removeAttribute("lname");
			session.removeAttribute("email");
			session.invalidate();

			res.sendRedirect("./index.jsp");

		}catch(Exception e)
		{
			e.printStackTrace();
		}

	}
}
